﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Runda.EShop.Common.Utility;
using Runda.EShop.Common.Entity;
using Runda.EShop.Bll;

namespace Runda.EShop.Web
{
    public partial class Default : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Initialize();
            }
        }

        private void Initialize()
        {
            //公告
            List<SqlDbParameter> parms = new List<SqlDbParameter>();
            int RecordCount = 0;
            SysNoticeBll bll = new SysNoticeBll();
            List<SysNoticeEntity> list = bll.GetNoticeListNonContent(parms, " CreatedAt DESC", 6, 0, out RecordCount);

            rptNoticeList.DataSource = list;
            rptNoticeList.DataBind(); 

            //待确认订单
            int OrderCount = bll.Count<BizOrderEntity>(" and CustomerID='"+base.User.Identity.LoginUser.UserID+"' and OrderStatus = 1");
            ltlOrderCount.Text = OrderCount.ToString();
        }
    }
}